package com.olf.service.exception;

import javax.ws.rs.core.Response;
import javax.ws.rs.ext.ExceptionMapper;
import javax.ws.rs.ext.Provider;

/*
 * Classe que mapeia as exceptions de 'IllegalArgumentException' para o status HTTP 400(BAD REQUEST)
 * @author Rafael Nunes
 */

@Provider
public class IllegalArgumentExceptionMapper implements ExceptionMapper<IllegalArgumentException> {

    public Response toResponse(IllegalArgumentException ie) {
        return Response.status(Response.Status.BAD_REQUEST).build();
    }
}